home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 11358 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: macqbl.com.au!usenet
  2. From: drubie@macquarie.com.au (David Rubie)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Obtaining IP Address
  5. Date: 14 Mar 1996 01:18:35 GMT
  6. Organization: Macquarie Bank Ltd.
  7. Message-ID: <4i7s5b$mp6@mblisd.macqbl.com.au>
  8. References: <314665EC.4AF7@ebicom.net>
  9. Reply-To: drubie@macquarie.com.au
  10. NNTP-Posting-Host: isd47.macqbl.com.au
  11.  
  12. In article <314665EC.4AF7@ebicom.net>, trahan <trahan@ebicom.net> writes:
  13. >That's using windows operating system.  It is really proving to be a big 
  14. >pain in the rear if you know what I mean.
  15. >
  16. >We can not determine how to get our own IP address even though we know 
  17. >its available to the operating system.  Any info you might be able to 
  18. >pass our way would be helpful.
  19.  
  20. The most portable way to do it is via the WINSOCK stuff.  Get a book
  21. about programming sockets under windows.  The WINSOCK interface provides
  22. a standard, portable way of retrieving both the hostname of the machine
  23. (gethostname()) and the other details (like the IP address) via
  24. gethostbyname().
  25.  
  26. WINSOCK might also be able to retrieve the IP address directly, but
  27. I don't have the documentation handy.
  28.  
  29. dave.
  30.  
  31. -- 
  32. -------------------------------------------------------
  33. David Rubie
  34. Macquarie Bank Ltd.
  35. drubie@macqbl.com.au
  36.  
  37.  
  38.